#include <iostream>
#include <vector>
using namespace std;

const int MOD = 1000000007;

vector<int> memo;

int f(int n) {
  if (n == 1)
    return 1;
  if (n == 2)
    return 3;

  if (memo[n] != -1)
    return memo[n];

  memo[n] = (f(n - 1) + 2LL * f(n - 2)) % MOD;
  return memo[n];
}

int main() {
  int n;
  cin >> n;

  memo.resize(n + 1, -1);

  cout << f(n) << endl;
  return 0;
}
